<template>
    <view :class="['sort-types', 'data-v-6677e6fa', paddingRight ? 'padding-right' : '']">
        <view :class="['type-item', 'data-v-6677e6fa', type === 'sale' ? 'actived' : '']">
            <i-picker
                @__l="__l($event, { eventOpts: [['^input', [['__set_model', ['', 'itemType', '$event', []]]]]] })"
                @input="__e($event, { eventOpts: [['^input', [['__set_model', ['', 'itemType', '$event', []]]]]] })"
                class="data-v-6677e6fa"
                :data-event-opts="[['^input', [['__set_model', ['', 'itemType', '$event', []]]]]]"
                :list="itemTypeList"
                :value="itemType"
                vueId="30e7448c-1"
            ></i-picker>
        </view>
        <view @tap="__e" :class="['type-item', 'data-v-6677e6fa', type === 'time' ? 'actived' : '']" :data-event-opts="[['tap', [['setSort', ['time']]]]]">
            <text class="data-v-6677e6fa">新品</text>
        </view>
        <view @tap="__e" :class="['type-item', 'data-v-6677e6fa', type === 'price' ? 'actived' : '']" :data-event-opts="[['tap', [['setSort', ['price']]]]]">
            <text class="data-v-6677e6fa">价格</text>
            <view class="mark-c data-v-6677e6fa">
                <view :class="['data-v-6677e6fa', true ? 'mark' : '', true ? 'up' : '', sort === 'price_asc' ? 'active' : '']"></view>
                <view :class="['data-v-6677e6fa', true ? 'mark' : '', true ? 'down' : '', sort === 'price_desc' ? 'active' : '']"></view>
            </view>
        </view>
        <view @tap="__e" class="type-item data-v-6677e6fa" :data-event-opts="[['tap', [['toCategoryPage', ['$event']]]]]">
            <text class="data-v-6677e6fa">找分类</text>
        </view>
    </view>
</template>

<script>
import iPicker from '@/components/IPicker/IPicker';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['pages/search/components/sortBar'],
    {
        2791: function (t, e, n) {
            'use strict';

            var o = n('a565');
            n.n(o).a;
        },
        '2c55': function (t, e, n) {
            'use strict';

            n.r(e);
            var o = n('f73b');
            var a = n('9379');
            for (var r in a) {
                if (['default'].indexOf(r) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return a[t];
                        });
                    })(r);
                }
            }
            n('2791');
            var i = n('f0c5');
            var s = Object(i.a)(a.default, o.b, o.c, false, null, '6677e6fa', null, false, o.a, void 0);
            e.default = s.exports;
        },
        9379: function (t, e, n) {
            'use strict';

            n.r(e);
            var o = n('a006');
            var a = n.n(o);
            for (var r in o) {
                if (['default'].indexOf(r) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return o[t];
                        });
                    })(r);
                }
            }
            e.default = a.a;
        },
        a006: function (t, e, n) {
            'use strict';

            (function (t) {
                Object.defineProperty(e, '__esModule', {
                    value: true
                });
                e.default = void 0;
                var n = {
                    props: {
                        paddingRight: {
                            type: Boolean,
                            default: function () {
                                return true;
                            }
                        },
                        defaultItemType: {
                            type: String
                        }
                    },
                    data: function () {
                        return {
                            sort: '',
                            type: 'hot',
                            itemType: 'all',
                            itemTypeList: [
                                {
                                    label: '搜全部',
                                    key: 'all'
                                },
                                {
                                    label: '搜盲盒',
                                    key: 'box'
                                },
                                {
                                    label: '搜商品',
                                    key: 'product'
                                }
                            ]
                        };
                    },
                    watch: {
                        itemType: function () {
                            this.$emit('setType', this.itemType);
                        }
                    },
                    mounted: function () {
                        this.itemType = this.defaultItemType;
                    },
                    methods: {
                        toCategoryPage: function () {
                            t.navigateTo({
                                url: '/pages/category/index'
                            });
                        },
                        setSort: function (t) {
                            this.type = t;
                            if ('time' === t || 'sale' === t) {
                                this.sort = t + '_desc';
                                this.$emit('setSort', this.sort);
                                return false;
                            }
                            var e = t + '_desc';
                            var n = t + '_asc';
                            this.sort = this.sort === e ? n : e;
                            this.$emit('setSort', this.sort);
                        }
                    }
                };
                e.default = n;
            }.call(this, n('543d').default));
        },
        a565: function (t, e, n) {},
        f73b: function (t, e, n) {
            'use strict';

            n.d(e, 'b', function () {
                return a;
            });
            n.d(e, 'c', function () {
                return r;
            });
            n.d(e, 'a', function () {
                return o;
            });
            var o = {
                IPicker: function () {
                    return n.e('components/IPicker/IPicker').then(n.bind(null, 'c89e'));
                }
            };
            var a = function () {
                this.$createElement;
                this._self._c;
            };
            var r = [];
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'pages/search/components/sortBar-create-component',
    {
        'pages/search/components/sortBar-create-component': function (t, e, n) {
            n('543d').createComponent(n('2c55'));
        }
    },
    [['pages/search/components/sortBar-create-component']]
]);
</script>
<style>
@import './sortBar.css';
</style>
